\newcommand{\sectionmajornumbering}
{
    % \renewcommand*{\thesection}{\arabic{section}}

    \counterwithin*{figure}{section}
    \renewcommand{\thefigure}{\arabic{section}.\arabic{figure}}

    \counterwithin*{table}{section}
    \renewcommand{\thetable}{\arabic{section}.\arabic{table}}

    \counterwithin*{lstlisting}{section}
    \renewcommand{\thelstlisting}{\arabic{section}.\arabic{lstlisting}}

    \counterwithin*{equation}{section}
    \renewcommand{\theequation}{\arabic{section}-\arabic{equation}}
}

\newcommand{\chaptermajornumbering}
{
    \counterwithin*{figure}{chapter}
    \renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}

    \counterwithin*{table}{chapter}
    \renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}

    \counterwithin*{lstlisting}{chapter}
    \renewcommand{\thelstlisting}{\arabic{chapter}.\arabic{lstlisting}}

    \counterwithin*{equation}{chapter}
    \renewcommand{\theequation}{\arabic{chapter}-\arabic{equation}}
}

\newcommand{\appendixsubsecmajornumbering}
{
    \ctexset{
        subsection/number = \Alph{subsection},
        subsubsection/number = \Alph{subsection}.\arabic{subsubsection}
    }

    % Fix hyperref link for subsections in appendix
    \stepcounter{section}

    \counterwithin*{figure}{subsection}
    \renewcommand{\thefigure}{\Alph{subsection}.\arabic{figure}}

    \counterwithin*{table}{subsection}
    \renewcommand{\thetable}{\Alph{subsection}.\arabic{table}}

    \counterwithin*{lstlisting}{subsection}
    \renewcommand{\thelstlisting}{\Alph{subsection}.\arabic{lstlisting}}

    \counterwithin*{equation}{subsection}
    \renewcommand{\theequation}{\Alph{subsection}-\arabic{equation}}
}

\newcommand{\appendixsecmajornumbering}
{
    \ctexset{
        section/number = \Alph{section},
        subsection/number = \Alph{section}.\arabic{subsection}
    }

    % Fix hyperref link for sections in appendix
    \stepcounter{chapter}

    \counterwithin*{figure}{section}
    \renewcommand{\thefigure}{\Alph{section}.\arabic{figure}}

    \counterwithin*{table}{section}
    \renewcommand{\thetable}{\Alph{section}.\arabic{table}}

    \counterwithin*{lstlisting}{section}
    \renewcommand{\thelstlisting}{\Alph{section}.\arabic{lstlisting}}

    \counterwithin*{equation}{section}
    \renewcommand{\theequation}{\Alph{section}-\arabic{equation}}
}

\newcommand{\numberingstyle}
{
    \ifthenelse{\equal{\Degree}{undergraduate}}
    {
        \ifthenelse{\equal{\undergradcurrstage}{proposal}}
        {
            \chaptermajornumbering
        }
        {
            \sectionmajornumbering
        }
    }
    {
        \chaptermajornumbering
    }
}
